<template>
	<view class="centent">
		<view class="neirong">
			<u-parse :content="content"></u-parse>
		</view>

	</view>
</template>

<script>
	import {
		getxieyi,
		index
	} from '@/api/user.js'
	export default {
		data() {
			return {
				content: ``,
				goods_id: '',
			}
		},
		onLoad(option) {
			this.goods_id = option.id
			if(option.id == 1){
				uni.setNavigationBarTitle({
					title: '用户协议'
				})
			}else if (option.id == 2) {
				uni.setNavigationBarTitle({
					title: '服务协议'
				})
			} else {
				uni.setNavigationBarTitle({
					title: '隐私政策'
				})
			}
			this.get_index()
		},
		methods: {
			get_index(){
				index({}).then(res => {
					console.log("获取文章列表",res);
					if(res.code == 1){
						if (this.goods_id == 1) {
							this.content = res.data.xieyi.yonghuxieyi
						} else if (this.goods_id == 2){
							this.content = res.data.xieyi.fuwuxieyi
						}else {
							this.content = res.data.xieyi.yinsixieyi
						}
					}
				})
			},
			
		}
	}
</script>

<style>
	.neirong {
		width: 688rpx;
		font-size: 28rpx;
		font-weight: 500;
		text-align: justifyLeft;
		color: #666666;
		line-height: 48rpx;
		margin: auto;
		margin-top: 33rpx;
	}

	.nr-one text {
		display: block;
		margin-top: 30rpx;
	}

	.nr-two {
		margin-top: 30rpx;
	}

	.nr-two-nei {
		display: block;
		width: 630rpx;
		margin-left: 58rpx;
	}

	page {
		padding-bottom: 50rpx;
	}
</style>